#!/usr/bin/env python
# encoding: utf-8
#
# @author: szy
#
import sys
import os

sys.path.append('./helper')
# from ConfigReader import ConfigReader
# import InfoMonConstants
from helper.ConfigReader import ConfigReader
from helper import InfoMonConstants
# from ConnectionHelper import ConnectionHelper
from helper import ConnectionHelper

sys.path.append('./task')
# from ExecuteScripts import ExecuteScripts
# from Collector import Collector
from task import ExecuteScripts
from task.Collector import Collector


# 初始化常量
def init():
    InfoMonConstants.CONfPATH = './etc/mon.cfg'
    cfg = ConfigReader(InfoMonConstants.CONfPATH)
    InfoMonConstants.HOST = cfg.get('host')
    InfoMonConstants.PORT = cfg.get('port')
    InfoMonConstants.USER = cfg.get('user')
    InfoMonConstants.PASSWORD = cfg.get('password')
    InfoMonConstants.SID = cfg.get('sid')
    InfoMonConstants.ENDPOINT = cfg.get('endpoint')
    InfoMonConstants.FALCON_CLINENT = cfg.get('falcon_client')
    InfoMonConstants.LOG_FILE = cfg.get('log_file')
    InfoMonConstants.LOG_LEVEL = cfg.get('log_level')
    InfoMonConstants.TYPE = cfg.get('type')


def Main():
    init()

    # 执行脚本, for mongo
    #exeCute = ExecuteScripts()
    #exeCute.execute()
    # 数据收集, 测试输出
    c = Collector()
    c.collect()

    #c.run()


if __name__ == '__main__':
    Main()




